home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Compilers⁄Interps / kevoSource / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-08  |  1.7 KB  |  49 lines  |  [TEXT/KAHL]

  1. /* Kevo -- a prototype-based object-oriented language */
  2. /* (c) Antero Taivalsaari 1991-1993                   */
  3. /* Some parts (c) Antero Taivalsaari 1986-1988           */
  4. /* main.c: Kevo system initialization                   */
  5.  
  6. #include "global.h"
  7.  
  8. static char kevo[]   = "Kevo Interactive Compiler Kernel";
  9. static char author[] = "Copyright (c) 1992 Antero Taivalsaari";
  10.  
  11. void main(argc, argv) 
  12. int   argc;
  13. char* argv[];
  14.   PAIR* systemInitPair;
  15.  
  16.     printf("Loading the image file 'kevo.img'...\n");
  17.     
  18.     initRootContexts();            /* Initialize root contexts for names (context.c) */
  19.     initPrimitives();            /* Add (portable) primitives to root context (prim.c) */
  20.     initPortedPrims();            /* Add non-portable primitives (portPrim.c) */
  21.  
  22.     openImage(argc, argv);        /* Open the image file (image.c) */
  23.     loadImage();                /* Load the image file to the system (image.c) */
  24.  
  25.     initRootFamilies();            /* Add the clone family lists to basic contexts */
  26.     initVariables();             /* Initialize certain variables (image.c) */
  27.     initStacks();                 /* Initialize execution stacks (kernel.c) */
  28.     initFiles();                 /* Initialize standard files (files.c) */
  29.   
  30.     /* Search the 'boot' operation from the root context */
  31.     systemInitPair = findPairInThis(rootContext, "SystemInit");
  32.     if (systemInitPair) {
  33.         ip = (int**)systemInitPair->ofa->mfa;
  34.  
  35.         initSignals();            /* Set the signal handler function (signals.c) */
  36.         initGUI();                /* Initialize graphical user interface (portEvents.c) */
  37.  
  38.         preemptiveInterpreter(); /* Start the preemptive inner interpreter (kernel.c) */
  39.     }
  40.     else {
  41. /*        printf("%s: 'SystemInit' operation missing from image file \"%s\".\n", argv[0], argv[1]); */
  42.         printf("'SystemInit' operation missing from the image file 'kevo.img'.\nCannot continue. Exiting.\n");
  43.         exit(1);
  44.     }
  45. }
  46.  
  47.  
  48.